<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title>文章</title>
  <meta http-equiv="Access-Control-Allow-Origin" content="*" />
  <!-- title图标 -->
  <link rel="shortcut icon" type="image/x-icon" href="public/images/huobi.png" />
  <!-- 新 Bootstrap 核心 CSS 文件 -->
  <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
  <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
  <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
  <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
  <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
  <!-- 样式表-->
  <link href="public/css/index.css" rel="stylesheet">
  <link href="public/css/request.css" rel="stylesheet">
  <!-- js文件 -->
  <script src="public/js/jquery.min.js"></script>
  <script src="public/js/script.js"></script>
  <script src="public/js/snippet.js"></script>
  <script src="public/js/Token.js"></script>

  <!-- Vue的配置 -->
  <script src="https://cdn.jsdelivr.net/npm/vue"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.8/vue.min.js"></script>
</head>

<body>
  <!-- 头部内容部分 -->
  <div class="row clearfix">
    <div class="col-md-12 column">
      <header class="header">
        <div class="logo">
          <img src="public/images/logo.png" />
        </div>
        <div class="nav-wrapper">
          <span class="icon-menu"></span>
          <nav class="user-nav" id="user-nav">
            <a class="submit-a-request" href="SubmitRequests.html">提交请求</a>
          </nav>
        </div>
      </header>
    </div>
  </div>
  <!-- 中间主体内容部分 -->
  <main role="main">
    <div class="container-divider"></div>
    <div class="container">
      <nav class="sub-nav">
        <ol class="breadcrumbs">
          <li title="帮助中心">
            <a href="index.html">帮助中心</a>
          </li>
          <li title="Huobi Global 公告">
            <a href="HuobiNotice.html">Huobi Global 公告</a>
          </li>
          <li title="重要公告">
            <a href="">重要公告</a>
          </li>
        </ol>
        <div role="search" class="search " data-search="" autocomplete="off">
          <input name="" type="hidden" value="">
          <input type="search" name="" id="query" autocomplete="off" placeholder="搜索" autofocus="autofocus"
            aria-label="搜索">
        </div>
      </nav>
      <div class="article-container" id="article-container">
        <section class="article-sidebar">
          <section class="section-articles collapsible-sidebar">
            <h3 class="collapsible-sidebar-title sidenav-title">此组别内的文章</h3>
            <div id="ArticleNav">
              <ul v-for="site in datas">
                <li>
                  <!-- <a :href="'wenzhang.html?id='+v.ArticleId" :class="id==v.ArticleId?'sidenav-item current-article':'sidenav-item'" v-for="v in AllData.articleTbs">{{v.ArticleName}}</a>
                --> <a href="" class="sidenav-item">{{site.title}}</a>
                </li>
            </div>
            </ul>
          </section>
        </section>
        <article class="article">
          <div id="Article">
            <header class="article-header">
              <h1 class="article-title">
                {{title}}
              </h1>
              <div class="article-author">
                <div class="avatar article-avatar">
                  <!-- 头像 -->
                  <img
                    src="https://secure.gravatar.com/avatar/e13a2800becefa2cb262331d4c718d0f?default=https%3A%2F%2Fassets.zendesk.com%2Fhc%2Fassets%2Fdefault_avatar.png&amp;r=g"
                    alt="Avatar" class="user-avatar">
                  <svg t="1561208619164" class="icon" style="margin-top: 27px;margin-left:-20px" viewBox="0 0 1024 1024"
                    version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7412" width="22" height="22">
                    <path
                      d="M510.976182 158.867264c-194.228633 0-353.130689 158.901033-353.130689 353.134783 0 194.229656 158.902056 353.130689 353.130689 353.130689 194.229656 0 353.130689-158.901033 353.130689-353.130689C864.106872 317.768297 705.205838 158.867264 510.976182 158.867264M510.976182 264.801968c60.004629 0 105.935728 45.931099 105.935728 105.934704 0 60.078307-45.931099 105.931634-105.935728 105.931634-59.999512 0-105.931634-45.853327-105.931634-105.931634C405.044548 310.733067 450.975647 264.801968 510.976182 264.801968M510.976182 766.257821c-88.293929 0-165.93524-45.934169-211.866339-112.99654 0-70.656223 141.264351-109.475344 211.866339-109.475344 70.607104 0 211.871455 38.819121 211.871455 109.475344C676.912445 720.323653 599.274204 766.257821 510.976182 766.257821"
                      p-id="7413" fill="#474e70"></path>
                  </svg>
                </div>
                <div class="article-meta">
                  Huobi
                  <ul class="meta-group">
                    <li class="meta-data"></time> {{day}}</li>
                  </ul>
                </div>
              </div>
            </header>
            <section class="article-info">
              <div class="article-content">
                <div v-html="content" class="article-body">
                  {{content}}
                </div>
              </div>
            </section>
          </div>
          <!-- 底部内容 -->
          <footer>
            <div class="article-footer">
              <div class="article-share">
                <ul class="share">
                  <li><a href="" class="share-facebook">Facebook</a></li>
                  <li><a href="" class="share-twitter">Twitter</a></li>
                  <li><a href="" class="share-linkedin">LinkedIn</a></li>
                </ul>
              </div>
            </div>
            <div>
              <div class="article-votes" id="helpnum">
                <span class="article-votes-question">这篇文章有帮助吗？</span>
                <div class="article-votes-controls" role="radiogroup">
                  <a role="radio" rel="nofollow" class="button article-vote article-vote-up" title="是"
                    onclick="helpYes()" aria-selected="false"></a>
                  <a role="radio" rel="nofollow" class="button article-vote article-vote-down" title="否"
                    onclick="helpNo()" aria-selected="false"></a>
                </div>

                <small class="article-votes-count">
                  <span class="article-vote-label"><label id="sum">{{datas.totalNum}}</label>人中有<label
                      id="people">{{datas.helperNum}}</label>人觉得有帮助</span>
                </small>
              </div>
            </div>
            <div class="article-more-questions">
              还有其它问题？<a href="SubmitRequests.html">提交请求</a>
            </div>
            <div class="article-return-to-top">
              <a href="#article-container">返回页首<span class="icon-arrow-up"></span></a>
            </div>
          </footer>
          <section class="article-relatives">
            <section class="recent-articles">
              <h3>最近查看的文章</h3>
              <ul>
                <li><a href="">关于火币全球站暂停USDT (ERC20) 提币业务的公告</a></li>
                <li><a href="">关于防范假冒“搬砖套利”等各类形式诈骗的风险提示</a></li>
                <li><a href="">止盈止损介绍</a></li>
                <li><a href="">火币全球站关于推出阶梯手续费率制度并支持HT抵扣手续费方案的正式公告</a></li>
              </ul>
            </section>
            <section class="related-articles" id="ReleArticle">
              <h3>相关文章</h3>
              <ul v-for="site in datas">
                <li>
                  <a href="" rel="nofollow">{{site.title}}</a>
                </li>
              </ul>
            </section>

          </section>
          <div class="article-comments" id="article-comments">
            <section class="comments">
              <header class="comment-overview" id="counts">
                <h3 class="comment-heading">
                  评论
                </h3>
                <p class="comment-callout">{{count}}条评论</p>
                <div class="dropdown comment-sorter">
                  <a class="dropdown-toggle">排序方式<img src="public/images/xiangxia.svg" /></a>
                  <span class="dropdown-menu " role="menu">
                    <a id="date" class="datenum" name="1" role="menuitem">日期</a>
                    <a id="num" class="datenum" name="0" role="menuitem">投票数</a>
                  </span>
                </div>
              </header>
              <ul id="com" class="comment-list">
                <li class="comment" v-for="site in datas">
                  <div class="comment-wrapper">
                    <div class="comment-info">
                      <div class="comment-author">
                        <div class="avatar comment-avatar">
                          <img src="https://huobiglobal.zendesk.com/images/2016/default-avatar-80.png" alt="Avatar"
                            class="user-avatar">
                        </div>
                        <div class="comment-meta">
                          <span>
                            {{site.uname}}
                          </span>
                          <input type="hidden" id="commentid" v-bind:value="site.commentid">
                          <ul class="meta-group">
                            <li class="meta-data">{{site.commDate}}</li>
                          </ul>
                        </div>
                        <div class="comment-labels">
                        </div>
                      </div>
                      <section v-html="site.content" class="comment-body">
                        <p>{{site.content}}</p>
                      </section>
                    </div>
                    <div class="comment-actions-container">
                      <div class="comment-vote vote" role="radiogroup">

                        <a role="radio" rel="nofollow" class="vote-up" title="是" onclick="clickYes(this)"></a>
                        <span class="vote-sum">{{site.thumbs}}</span>
                        <a role="radio" rel="nofollow" class="vote-down" title="否" onclick="clickNo(this)"></a>
                      </div>
                      <div class="comment-actions actions">
                        <span class="dropdown">
                          <span class="dropdown-toggle"></span>
                          <span class="dropdown-menu" role="menu" aria-expanded="false">
                            <a role="menuitem" rel="nofollow" data-action="show-permalink" href="">固定链接</a>
                          </span>
                        </span>
                      </div>
                    </div>
                  </div>
                </li>
              </ul>
              <form data-form data-form-type="comment" class="comment-form" action="" id="kuang" accept-charset="UTF-8">
                <input name="utf8" type="hidden" value="✓">
                <input type="hidden" name="" value="">
                <div class="avatar comment-avatar">
                  <input type="hidden" id="content">
                  <img class="user-avatar" alt="" data-user-avatar="true" src="public/images/touxiang.png">
                  <input type="hidden" id="userid">
                  <div id="div1" class="toolbar" style="margin-left: 50px;margin-top: -35px">
                  </div>
                  <div style="padding: 5px 0; color: #ccc"></div>
                  <div id="contents" class="text" style="margin-left: 50px;">
                    <!--可使用 min-height 实现编辑区域自动增加高度-->
                  </div>
                  <div class="comment-form-controls">
                    <input type="button" name="commit" class="buttonss" style="margin-left:500px" id="commenttijiao"
                      value="提交">
                  </div>
                </div>
              </form>
              <p class="comment-callout" id="commentclose">评论已关闭</p><br>
              <p class="comment-callout" id="login">请<a onclick="$('iframe').css('display','block')"
                  href="javascript:;">登录</a>写评论。</p>
            </section>
          </div>
      </div>
      </section>
    </div>
    </article>
    </div>
    </div>
  </main>
  <script src="public/js/hc_enduser.js"></script>
  <!-- 底部内容 -->
  <footer class="footer">
    <div class="footer-inner">
      <a title="主页" href="#">帮助中心</a>
      <!-- 语言部分 -->
      <div class="footer-language-selector">
        <div class="dropdown language-selector" aria-haspopup="true">
          <div class="row clearfix">
            <div class="col-md-12 column">
              <div class="btn-group dropup">
                <a class="yuyan" data-toggle="dropdown" style="color:#4f6d8c ;border: none">简体中文<img
                    src="public/images/xiangxia.svg" /></a>
                <ul class="dropdown-menu" style="margin-left: -50px;">
                  <li>
                    <a href="#"> Deutsch</a>
                  </li>
                  <li>
                    <a href="#"> English (US)</a>
                  </li>
                  <li>
                    <a href="#">Español</a>
                  </li>
                  <li>
                    <a href="#"> Français</a>
                  </li>
                  <li>
                    <a href="#">日本語</a>
                  </li>
                  <li>
                    <a href="#">한국어</a>
                  </li>
                  <li>
                    <a href="#">Português</a>
                  </li>
                  <li>
                    <a href="#"> Русский</a>
                  </li>
                  <li>
                    <a href="#"> Türkçe</a>
                  </li>
                  <li>
                    <a href="#">Tiếng Việt</a>
                  </li>
                  <li>
                    <a href="#">繁體中文</a>
                  </li>
                </ul>
              </div>
            </div>

          </div>
        </div>

      </div>
    </div>
  </footer>
  <iframe src="login.html" style="display:none;width: 100%;height: 100%;position: absolute;top: 0px;" frameborder="no"
    scrolling="no"></iframe>
  <!-- js代码 -->
  <script type="text/javascript">
    var order = 1; //全局变量
    $(function () {
      //侧边栏
      ArticleNav();
      //文章所有内容
      Article();
      //相关文章
      ReleArticle();
      //评论是否开放
      YesNoOpencomment();
      //评论列表
      commentList();
      //一共多少评论
      commentcount();
      //页面一加载就会有帮助人数
      nums();
    })
    //文章导航的ajax方法
    function ArticleNav() {
      //得到栏目id
      var id = window.localStorage.getItem("Categoryid");
      $.ajax({
        url: "http://192.168.137.1:5001/api/values/ArticleNav?id=" + id,
        type: "post",
        dataType: "json",
        success: function (result) {
          new Vue({
            el: "#ArticleNav",
            data: {
              datas: result.list
            }
          })
        },
        error: function () {
          // alert("执行失败");
        }
      })
    }
    //文章所有内容ajax
    function Article() {
      //得到id
      var id = window.localStorage.getItem("articleid");
      $.ajax({
        url: "http://192.168.137.1:5001/api/values/Article?id=" + id,
        type: "get",
        dataType: "json",
        success: function (result) {
          new Vue({
            el: "#Article",
            data: result
          })
        },
        error: function () {
          // alert("执行失败");
        }
      })
    }
    //相关文章的ajax
    function ReleArticle() {
      //得到id
      var id = window.localStorage.getItem("articleid");
      $.ajax({
        url: "http://192.168.137.1:5001/api/values/ReleArticle?id=" + id,
        type: "post",
        dataType: "json",
        success: function (result) {
          new Vue({
            el: "#ReleArticle",
            data: {
              datas: result
            }
          })
        },
        error: function () {
          // alert("执行失败");
        }
      })
    }

    function dianznums(params) {
      //存储的是id的数据
      var str = $(params).attr("name");
      var name = params.children[0].innerText;
      //id是参数的名字
      window.localStorage.setItem("id", str);
      window.localStorage.setItem("parentname", name);
    }
    //点赞（是）
    function clickYes(params) { //params相当于一个元素
      var commentid = $("#commentid").val(); //评论id
      var par = $(params).parent().children("span"); //找到父级元素下面的span元素
      var flag = true;
      var thumb = window.localStorage.getItem("thumbs");
      if (thumb != "1") {
        $.ajax({
          url: "http://192.168.137.1:5001/api/values/Thumbs",
          type: "get",
          dataType: "json",
          data: {
            "Commentid": commentid,
            "flag": flag
          },
          success: function (result) {
            par.text(result);
         
          },
          error: function () {
            // alert("执行失败");
          }
        })
        window.localStorage.setItem("thumbs", "1");
      }

    }
    //点赞（否）
    function clickNo(params) {
      var commentid = $("#commentid").val(); //评论id
      var par = $(params).parent().children("span"); //找到父级元素下面的span元素
      var flag = false;
      var thumb = window.localStorage.getItem("thumbs");
      if (thumb == "1") {
        $.ajax({
          url: "http://192.168.137.1:5001/api/values/Thumbs",
          type: "get",
          dataType: "json",
          data: {
            "Commentid": commentid,
            "flag": flag
          },
          success: function (result) {
            par.text(result);
          },
          error: function () {
            // alert("执行失败");
          }
        })
        window.localStorage.setItem("thumbs", "0");
      }
    }

    //是否开评论(若评论开放再检查是否登陆)
    function YesNoOpencomment() {
      $("#login").css("display", "none");
      //得到文章id
      var articleid = window.localStorage.getItem("articleid");
      $.ajax({
        url: "http://192.168.137.1:5001/api/values/CheckComment?id=" + articleid,
        type: "post",
        dataType: "json",
        success: function (result) {
          if (result) {
            $("#commentclose").css("display", "none"); //评论框隐藏
            var token = getToken();
            headerSetup(token);
            $.ajax({
              type: "get",
              url: "http://192.168.137.1:5001/api/values/CheckLogin",
              success: function () {
                $("#kuang").css("display", "block");
                var token = getToken();
                $.ajax({
                  url: "http://192.168.137.1:5001/api/values/CommentUser",
                  contentType: "application/json; charset=utf-8",
                  data: {
                    "token": token
                  },
                  type: "get",
                  dataType: "json",
                  success: function (result) {
                    $("#userid").val(result.user.UserId);
                  },
                  error: function () {
                    // alert("执行失败！");
                  }
                })
              },
              error: function () {
                $("#login").css("display", "block"); //登录显示
                $("#kuang").css("display", "none");
              }
            });
          } else {
            $("#commentclose").css("display", "block");
          }
        },
        error: function () {
          // alert("执行失败");
        }
      })
    }
    //文章评论
    $("#commenttijiao").click(function () {
      var content = $("#content").val();
      var article = window.localStorage.getItem("articleid");
      var userid = $("#userid").val();
      var gettoke = getToken();
      headerSetup(getToken());
      var comlist = {
        "Userid": userid,
        "Articleid": article,
        "Content": content,
      }
      $.ajax({
        url: "http://192.168.137.1:5001/api/values/AddComment",
        contentType: "application/json; charset=utf-8",
        type: "post",
        data: JSON.stringify(comlist),
        dataType: "json",
        success: function (result) {
          datas: result;
          window.location.reload(); //父级页面刷新
        },
        error: function () {
          // alert("执行失败");
        }
      })
    })
    //排序
    $(".datenum").click(function () {
      var datenum = $(this).attr("name");
      var order = datenum;
      commentList();
    })
    //评论列表
    function commentList() {
      var v = [];
      var id = window.localStorage.getItem("articleid");
      $.ajax({
        url: "http://192.168.137.1:5001/api/values/CommentList",
        contentType: "application/json; charset=utf-8",
        data: {
          "id": id,
          "order": order
        },
        type: "get",
        dataType: "json",
        success: function (result) {
          console.log(result.list)
          new Vue({
            el: "#com",
            data: {
              datas: result.list,
              count: result.total,
            }
          })
        },
        error: function () {
          // alert("执行失败");
        }
      })
    }
    //一共多少评论
    function commentcount() {
      var v = [];
      var id = window.localStorage.getItem("articleid");
      $.ajax({
        url: "http://192.168.137.1:5001/api/values/CommentList",
        contentType: "application/json; charset=utf-8",
        data: {
          "id": id,
          "order": order
        },
        type: "get",
        dataType: "json",
        success: function (result) {
          console.log(result.list)
          new Vue({
            el: "#counts",
            data: {
              datas: result.list,
              count: result.total,
            }
          })
        },
        error: function () {
          // alert("执行失败");
        }
      })
    }
    //页面一加载就会有帮助人数
    function nums() {
      var articleid = window.localStorage.getItem("articleid");
      $.ajax({
        url: "http://192.168.137.1:5001/api/values/TotalNum?id=" + articleid,
        type: "post",
        dataType: "json",
        success: function (result) {
          console.log(result);
          console.log(result)
          new Vue({
            el: "#helpnum",
            data: {
              datas: result
            }
          })
        },
        error: function () {
          //  alert("执行失败");
        }
      })
    }
    //点击是否有帮助(有帮助)
    function helpYes() { //params相当于一个元素
      var article = window.localStorage.getItem("articleid"); //文章id
      var flag = true;
      var yes = window.localStorage.getItem("helpnum");
      if (yes != "1") {
        $.ajax({
          url: "http://192.168.137.1:5001/api/values/HeplerNum",
          type: "get",
          dataType: "json",
          data: {
            "id": article,
            "result": flag
          },
          success: function (result) {
            $("#sum").html(result.totalNum);
            $("#people").html(result.HelperNum);
            window.location.reload();

          },
          error: function () {
            // alert("执行失败");
          }
        })
        window.localStorage.setItem("helpnum", "1");
      }
    }
    //点击是否有帮助(没有帮助)
    function helpNo() {
      var article = window.localStorage.getItem("articleid"); //文章id
      var flag = false;
      var no = window.localStorage.getItem("helpnum");
      if (no == "1") {
        $.ajax({
          url: "http://192.168.137.1:5001/api/values/HeplerNum",
          type: "get",
          dataType: "json",
          data: {
            "id": article,
            "result": flag
          },
          success: function (result) {
            $("#sum").html(result.totalNum);
            $("#people").html(result.HelperNum);
            window.location.reload();
          },
          error: function () {
            // alert("执行失败");
          }
        })
        window.localStorage.setItem("helpnum", "0");
      }
    }
  </script>
</body>
<script src="public/js/hc_enduser.js"></script>
<!-- 富文本框样式 -->
<script src="release/wangEditor.min.js"></script>
<script>
  var E = window.wangEditor
  var editor = new E('#div1', '#contents')
  var $text1 = $("#content")
  editor.customConfig.uploadImgServer = 'http://192.168.137.1:5001/api/values/UpfileImage'
  //editor.customConfig.uploadImgShowBase64 = true
  // editor.customConfig.withCredentials = true
  // 自定义菜单配置
  editor.customConfig.menus = [
    'bold', // 粗体
    'fontName', // 字体
    'italic', // 斜体
    'underline', // 下划线
    'link', // 插入链接
    'list', // 列表
    'justify', // 对齐方式
    'emoticon', // 表情
    'image', // 插入图片
  ]
  editor.customConfig.zIndex = 1
  editor.customConfig.uploadImgHooks = {
      customInsert: function (insertImg, result, editor) {
        var url = result.data;
        insertImg(url);
      }
    },
    editor.customConfig.onchange = function (html) {
      $text1.val(html)
    }
  editor.create()
  // editor.txt.html(decodeHtml)
  //鼠标回车事件
  var query; //定义全局变量
  // 搜索enter键按下事件
  $('#query').keydown(function () {
    if (event.keyCode == "13") {
      //获取文本框里面的值
      query = $("#query").val();
      location.href = "search.html#" + query;
    }
  })
</script>

</html>